{% extends 'database/base.html' %}

{% block title_content %}饭堂信息{% endblock %}

{% block body_content %}
    <h1 class="display-1">管理员{{name}}的食堂列表</h1>
    <table class="table">
        <thead>
            <tr>
                <th>ID</th>
                <th>管理员ID</th>
                <th>名字</th>
                <th>地址</th>
                <th>电话号</th>
                <th>编辑信息</th>
            </tr>
        </thead>
        <tbody>
            {% for item in object_list %}
            <tr>
                <td>{{ item.id }}</td>
                <td>{{ item.adm_id }}</td>
                <td>{{ item.name }}</td>
                <td>{{ item.address }}</td>
                <td>{{ item.telNum }}</td>
                <td><a href="{% url 'delivery_database:canteen_detail' id item.pk %}" >点击编辑</a></td>
            </tr>
            {% empty %}
                <tr>
                    <td colspan="5">暂无数据</td>
                </tr>
            {% endfor %}
        </tbody>
    </table>
    <p>
        <a class="btn btn-primary" href="{% url 'delivery_database:canteen_create' id %}">创建食堂</a>
        <a class="btn btn-primary" href="{% url 'index' %}">退出登录</a>
    </p>

{% endblock %}